package com.qire.manhua.model.enumeration;

import android.view.View;

import com.qire.manhua.R;

/**
 * 首页分类选项卡类型枚举
 */
public final class Classification {

    private Classification() {
        throw new UnsupportedOperationException("不需要初始化这个类");
    }

    /**
     * 收费类型
     */
    public enum FeeType{
        ALL("all","全部"),
        FREE("0","免费"),
        PAY("2","付费"),
        VIP("3","会员");

        public final String type;
        public final String typeName;

        FeeType(String type, String typeName){
            this.type = type;
            this.typeName = typeName;
        }
    }

    /**
     * 连载状态
     */
    public enum StateType{
        ALL("all","全部"),
        UNFINISHED("0","连载"),
        FINISH("1","完结");

        public final String type;
        public final String typeName;

        StateType(String type, String typeName){
            this.type = type;
            this.typeName = typeName;
        }
    }

    /**
     * 排序方式
     */
    public enum SortType{
        RECOMMEND("1","推荐"),
        POPULARITY("2","人气"),
        NEWEST("3","最新");

        public final String type;
        public final String typeName;

        SortType(String type, String typeName){
            this.type = type;
            this.typeName = typeName;
        }

        public static SortType next(SortType sortType){
            switch (sortType){
                case RECOMMEND :
                    return POPULARITY;
                case POPULARITY :
                    return NEWEST;
                case NEWEST :
                default:
                    return RECOMMEND;
            }
        }
    }

    public enum FoldState {
        FOLD(View.VISIBLE, R.drawable.app_home_classification_icon_arrow_down),
        UNFOLD(View.GONE, R.drawable.app_home_classification_icon_arrow_up);

        public final int visible;
        public final int iconRid;

        FoldState(int visible, int iconRid) {
            this.visible = visible;
            this.iconRid = iconRid;
        }
    }
}
